<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<select name="sel1" onchange="selChange(this)">
	<option value="0">请选择</option>
	<option value="3">东方娃娃</option>
  <option value="5">东方宝宝</option>
  <option value="7">创意美术</option>
</select>
<select name="sel2" onchange="alert(this.value);">
	<option>请选择</option>
</select>
<script type="text/javascript" src="images/javascript/jquery.js"></script>
<script type="text/javascript">
var sel=new Object();
sel[3]=[{value:11,name:"东方娃娃1"},{value:12,name:"东方娃娃2"},{value:13,name:"东方娃娃3"}];
sel[5]=[{value:21,name:"东方宝宝1"},{value:22,name:"东方宝宝2"},{value:23,name:"东方宝宝3"}];
sel[7]=[{value:31,name:"创意美术1"},{value:32,name:"创意美术2"},{value:33,name:"创意美术3"}];

function selChange(e){
	alert(e.value);
	var selObj = document.getElementsByName("sel2");
	$("option",selObj).remove();
	$("<option value='0'>请选择</option>").appendTo(selObj);
		
	if (e.value!=0){	
		for(var i=0;i<sel[e.value].length;i++)
		{
			var selData = sel[e.value];
			$("<option value='"+selData[i].value+"'>"+selData[i].name+"</option>").appendTo(selObj);
		}
	}
}
</script>
</body>
</html>
